<template>
  <div>
    <material-table ref="materialRef"/>
    <hr color="#eee" style="margin-bottom: 20px" />
    <performance ref="performanceRef" :isShow='false' titleLeft="性能参数"/>
    <div class="display-flex justify-content-flex-center" style="margin-top:15px">
      <el-button
        type="primary"
        icon="el-icon-search"
        size="mini"
        @click="handleQuery"
        >搜索</el-button
      >
      <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
        >重置</el-button
      >
    </div>
  </div>
</template>

<script>
import MaterialTable from "./MaterialTable.vue";
import Performance from "../../product/components/Performance.vue";
export default {
  components: { MaterialTable, Performance },
  data() {
    return {

    };
  },
  methods: {
    handleQuery() {
      let materialQuery=this.$refs.materialRef.getQuery()
      let performance=this.$refs.performanceRef.setSelectItems.map(item=>{
        return {paramId:item.paramId,value:item.value}
      })
      let query={...materialQuery,paramIds:JSON.stringify(performance)}
      this.$emit('getProcessOptimization',query)
    },
    resetQuery() {},
  },
};
</script>

<style lang="scss" scoped>
.left-title {
  padding-bottom: 20px;
  font-size: 14px;
  color: #606266;
  font-weight: bold;
}
</style>>
